package com.doit.demo03;

import java.io.*;
//给input加上readerline功能
//给output加上newline功能
public class test02 {
    public static void main(String[] args) throws IOException {
        InputStream in = new FileInputStream("d:\\work\\编码\\编码.txt");
        InputStreamReader arr = new InputStreamReader(in);
        BufferedReader br= new BufferedReader(arr);
        String line = br.readLine();
        System.out.println(line);
        br.close();

        //总结以下就是这样
        BufferedReader bb = new BufferedReader(new InputStreamReader(new FileInputStream("d:\\work\\编码\\编码.txt")));
        String shuju = bb.readLine();
        System.out.println(shuju);
        bb.close();

        OutputStream out = new FileOutputStream("d:\\work\\编码\\编码.txt",true);
        OutputStreamWriter er = new OutputStreamWriter(out);
        BufferedWriter bw = new BufferedWriter(er);
        bw.newLine();
        bw.newLine();
        bw.write("增加newline功能");
        bw.close();


    }
}
